/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package haw.pr2.A2a.implementations;

import haw.pr2.A2a.interfaces.Mass;

/**
 *
 * @author Fabian Heidorn, Alexander Kaack
 */
public class MassInKg extends AbstractScalar<Mass> implements Mass{

    private final double massInKg;
    
    public MassInKg(double massInKg) {
        this.massInKg=massInKg;
    }

    @Override
    public Mass inverse() {
        return new MassInKg(-this.kg());
    }

    @Override
    public Mass add(Mass value) {
        return new MassInKg(this.kg()+value.kg());
    }

    @Override
    public Mass sub(Mass value) {
        return new MassInKg(this.kg()-value.kg());
    }

    @Override
    public Mass mul(Mass value) {
        return new MassInKg(this.kg()*value.kg());
    }

    @Override
    public Mass div(double value) {
        return new MassInKg(this.kg()/value);
    }

    @Override
    public double div(Mass value) {
        return this.kg()/value.kg();
    }

    @Override
    public boolean isZero() {
        return this.kg()==ZERO_MASS.kg();
    }

    @Override
    public boolean isValid() {
        return true;
    }

    @Override
    public double kg() {
        return this.massInKg;
    }

    @Override
    public double g() {
        return this.kg()*KG_IN_G;
    }

    @Override
    public double t() {
        return this.kg()*KG_IN_T;
    }
    
}
